1.
Berguna ketika akan menampilkan data dengan kondisi yang bergantung pada data didalam tabel itu sendiri, adalah...
Correct Answer
C. Subquery
Explanation
A subquery is useful when displaying data with conditions that depend on data within the table itself. It allows for more complex and dynamic queries by nesting one query inside another. This can be helpful in situations where you need to retrieve data based on certain criteria that cannot be achieved with a simple query. Subqueries are commonly used in SQL to filter, sort, or aggregate data from multiple tables.
2.
Tidak termasuk sebutan atau nama lain dari subquery adalah...
Correct Answer
B. Outer-query
Explanation
The correct answer is "outer-query" because the question is asking for a term or another name for a subquery that is not included in the given options. An outer query refers to the main query that contains the subquery, which is a query nested within another query. The other options provided, such as inner-select, subselect, nested select, and nested query, all refer to different ways of describing a subquery.
3.
Tidak termasuk query SELECT yang ada didalam perintah SQL lain yaitu...
Correct Answer
A. CREATE
Explanation
The given correct answer is "CREATE". In SQL, the CREATE statement is used to create a new table, view, index, or other database objects. It is not a query that is used to retrieve data from the database. The other options mentioned (INSERT, DELETE, SELECT, UPDATE) are all query statements used to manipulate or retrieve data from the database.
4.
Akan dikerjakan terlebih dahulu dan hasilnya akan digunakan sebagai pembanding pada pencarian data di klausa where adalah kegunaan dari...
Correct Answer
C. Inner query
Explanation
The given correct answer is "Inner query". An inner query is used to perform a separate query within the main query and its results are then used for comparison or filtering in the WHERE clause. In this case, the inner query is being performed first to obtain some results, which will then be used for comparison in the WHERE clause to search for specific data.
5.
Perhatikan pernyataan berikut ini!
1. Meng-copy data dari satu tabel ke tabel lain
2. Untuk mengirimkan dan menyediakan keperluan dari client
3. Menerima data dari inline view
4. Digunakan untuk menghasilkan baris data dengan menggabungkan 2 buah tabel atau lebih
Mana yang merupakan kegunaan subquery?
Correct Answer
B. 1 dan 3
Explanation
The correct answer is 1 and 3. The first statement mentions copying data from one table to another, which is not a typical use case for a subquery. The second statement talks about sending and providing client needs, which is not related to subqueries. The third statement mentions receiving data from an inline view, which is a common use of subqueries. The fourth statement talks about generating rows by combining multiple tables, which is also a common use of subqueries. Therefore, the correct answer is 1 and 3, as they both describe the uses of subqueries.
6.
Subquery yang hanya menghasilkan satu baris data adalah...
Correct Answer
A. Scalar subquery
Explanation
A scalar subquery is a subquery that returns only a single value or row of data. It is used to retrieve a single value from a subquery and can be used in expressions or conditions. In this case, the question is asking for the type of subquery that produces only one row of data, and the correct answer is scalar subquery.
7.
Subquery yang dapat menghasilkan lebih dari satu baris dan lebih dari satu kolom data adalah...
Correct Answer
C. Multiple-column subquery
Explanation
A multiple-column subquery is a subquery that can return multiple rows and multiple columns of data. This means that the subquery can retrieve and process multiple pieces of information from a table or multiple tables. It can be used in the WHERE clause or the SELECT clause of a SQL statement to filter or retrieve data based on multiple conditions or criteria.
8.
Contoh operator perbandingan yang dapat digunakan pada klausa WHERE adalah...
Correct Answer
E. =
Explanation
The correct answer is "=" because the question is asking for a comparison operator that can be used in a WHERE clause. The "=" operator is used to check for equality between two values. In a WHERE clause, it is commonly used to filter rows based on a specific condition where a column value is equal to a specified value.
9.
Digunakan untuk mengurutkan hasil seleksi adalah fungsi dari klausa...
Correct Answer
E. ORDER BY
Explanation
The correct answer is "ORDER BY". This clause is used to sort the results of a selection in a specific order. It allows you to specify the column(s) by which you want to sort the data and the order in which you want them to be sorted (ascending or descending). By using the "ORDER BY" clause, you can organize the output of your query in a meaningful way, making it easier to analyze and understand the data.
10.
Perhatikan perintah SQL berikut.
INSERT INTO mahasiswa2 (NIM,Nama) SELECT NIM, Nama FROM mahasiswa;
Merupakan contoh dari...
Correct Answer
A. Subquery
Explanation
The given SQL command is an example of a subquery. A subquery is a query nested within another query. In this case, the subquery is selecting the NIM and Nama columns from the mahasiswa table, and then the selected values are being inserted into the mahasiswa2 table.
11.
Perintah SQL yang disediakan oleh semua program RDBMS untuk melakukan hubungan (relasi) multi-tabel yang memiliki pola hubungan tertentu disebut...
Correct Answer
B. JOIN
Explanation
The correct answer is JOIN. In SQL, the JOIN command is used to combine rows from two or more tables based on a related column between them. It allows us to retrieve data from multiple tables by specifying the relationship between them. By using JOIN, we can create a connection between tables and retrieve data that is related to each other based on the specified join condition.
12.
Pengambilan data pada Inner Join bersifat...
Correct Answer
A. Simetris
Explanation
The correct answer is "simetris". In an Inner Join, data is retrieved from both tables based on a matching condition. It is called "simetris" because it returns only the matching rows from both tables, creating a symmetrical result set.
13.
Perintah SQL: Nama varchar(30) NOT NULL, arti perintah SQL yang bergaris bawah adalah...
Correct Answer
D. Tidak boleh kosong
Explanation
The SQL command "NOT NULL" indicates that the field "Nama" cannot be left empty or null. It means that a value must be provided for the "Nama" field when inserting or updating data in the table.
14.
Query yang mendapatkan semua baris dalam tabel yang ada di sebelah kanan adalah pengertian dari...
Correct Answer
E. Right join
Explanation
A right join is a type of join that retrieves all the rows from the table on the right side of the join and only the matching rows from the table on the left side. This means that if there are any unmatched rows in the table on the right side, they will still be included in the result set. In other words, a right join ensures that all the rows from the table on the right side are included in the query result, regardless of whether there is a match with the table on the left side.
15.
Diagram Venn berikut merupakan penggambaran dari...
Correct Answer
B. Inner join
Explanation
The Venn diagram represents different types of joins in a database. The inner join is a type of join that returns only the matching records from both tables involved in the join. It excludes any non-matching records from the result set.
16.
Seluruh data pada tabel A dan tabel B akan ditampilkan, terlepas apakah ada kecocokan data antara kedua tabel tersebut atau tidak, merupakan ciri dari...
Correct Answer
C. Full join
Explanation
A full join is a type of join where all the data from both tables, regardless of whether there is a match between the tables or not, will be displayed. This means that even if there is no matching data between the two tables, the data from both tables will still be included in the result.
17.
Diagram Venn berikut merupakan penggambaran dari...
Correct Answer
E. Right join
Explanation
The diagram Venn represents different types of joins used in database management systems. The given answer, "right join," refers to a type of join where all the records from the right table and the matching records from the left table are included in the result set. This means that if there are unmatched records in the right table, they will still be included in the result set.
18.
Hanya menampilkan seluruh data pada tabel kiri dan menampilkan sebagian data dari tabel kanan yang memiliki kecocokan dengan data pada tabel kiri, merupakan ciri dari...
Correct Answer
C. Left join
Explanation
A left join is a type of join in which all the data from the left table is displayed, and only the matching data from the right table is included. This means that if there is no match in the right table, the result will still include the data from the left table. In this case, the given explanation suggests that the characteristic of displaying all the data from the left table and only the matching data from the right table is a feature of a left join.
19.
Perintah SELECT yang digunakan untuk menampilkan data semua kolom menggunakan...
Correct Answer
D. *
Explanation
The correct answer is "*". In SQL, the asterisk (*) is used in the SELECT statement to retrieve all columns from a table. It is a shorthand notation that eliminates the need to list out each individual column name. By using "*", the query will return all the data from every column in the specified table.
20.
Klausa pada SQL yang digunakan untuk membatasi data yang memenuhi kondisi tertentu yaitu...
Correct Answer
C. WHERE
Explanation
The clause used in SQL to restrict data that meets certain conditions is the WHERE clause. This clause allows us to specify conditions that must be met for the data to be included in the result set. It acts as a filter for the data and allows us to retrieve only the rows that satisfy the specified conditions.