Soal Bahasa SQL

SQL Language

SQL Language

Berikut ini adalah beberapa contoh soal untuk membantu rekan-rekan menguasai bahasa SQL dimana bahasa ini merupakan bahasa standar untuk pengaksesan relasi basis data. Bahasa SQL kependekan dari Structured Query Language. Bahasa ini merupakan bahasa yang sudah sangat terkenal di dunia pemrograman karena fleksiblitas yang ditawarkan sangat tinggi. Lalu bagaimana cara kita bisa mempelajarinya? Disini saya copy langsung dari Quiz yang pernah saya ikuti di W3Schools (http://www.w3schools.com) atau bisa langsung ikuti kuisnya di http://www.w3schools.com/quiztest/quiztest.asp?qtest=SQL . Supaya dapat mengetahui, disini rekan-rekan dapat langsung menikmati kuisnya tetapi dengan syarat jawaban tidak saya cantumkan dan diharapkan rekan-rekan bisa langsung mencobanya di link yang sudah saya berikan. Selamat Mencoba:

  1. 1. What does SQL Stand for?
    1. Structured Query Language
    2. Strong Question Languange
    3. Stuctured Question Language
    4. Standard Query Language
  2. Which SQL statement is used to extract data from a database?
    1. OPEN
    2. SELECT
    3. EXTRACT
    4. GET
  3. Which SQL statement is used to update data in a database?
    1. MODIFY
    2. SAVE AS
    3. UPDATE
    4. SAVE
  4. Which SQL statement is used to delete data from a database?
    1. COLLAPSE
    2. DELETE
    3. REMOVE
  5. Which SQL statement is used to insert new data in a database?
    1. INSERT INTO
    2. ADD NEW
    3. INSERT NEW
    4. ADD RECORD
  6. With SQL, how do you select a column named “FirstName” from a table named “Persons”?
    1. EXTRACT FirstName FROM Persons
    2. SELECT FirstName FROM Persons
    3. SELECT Persons.FirstName
  7. With SQL, how do you select all the columns from a table named “Persons”?
    1. SELECT *. Persons
    2. SELECT * FROM Persons
    3. SELECT [all] FROM Persons
    4. SELECT Persons
  8. With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” is “Peter”?
    1. SELECT [all] FROM Persons WHERE FirstName LIKE ‘Peter’
    2. SELECT [all] FROM Persons WHERE FirstName=’Peter’
    3. SELECT * FROM Persons WHERE FirstName=’Peter’
    4. SELECT * FROM Persons WHERE FirstName<>’Peter’
  9. With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” starts with an “a”?
    1. SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
    2. SELECT * FROM Persons WHERE FirstName=’a’
    3. SELECT * FROM Persons WHERE FirstName=’%a%’
    4. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
  10. The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
    1. TRUE
    2. FALSE
  11. With SQL, how do you select all the records from a table named “Persons” where the “FirstName” is “Peter” and the “LastName” is “Jackson”?
    1. SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’
    2. SELECT FirstName=’Peter’, LastName=’Jackson’ FROM Persons
    3. SELECT * FROM Persons WHERE FirstName<>’Peter’ AND LastName<>’Jackson’
  12. With SQL, how do you select all the records from a table named “Persons” where the “LastName” is alphabetically between (and including) “Hansen” and “Pettersen”?
    1. SELECT * FROM Persons WHERE LastName>’Hansen’ AND LastName<’Pettersen’
    2. SELECT * FROM Persons WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’
    3. SELECT LastName>’Hansen’ AND LastName<’Pettersen’ FROM Persons
  13. Which SQL statement is used to return only different values?
    1. SELECT UNIQUE
    2. SELECT DISTINCT
    3. SELECT DIFFERENT
  14. Which SQL keyword is used to sort the result-set?
    1. ORDER
    2. ORDER BY
    3. SORT
    4. SORT BY
  15. With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”?
    1. SELECT * FROM Persons ORDER BY FirstName DESC
    2. SELECT * FROM Persons SORT ‘FirstName’ DESC
    3. SELECT * FROM Persons ORDER FirstName DESC
    4. SELECT * FROM Persons SORT BY ‘FirstName’ DESC
  16. With SQL, how can you insert a new record into the “Persons” table?
    1. INSERT INTO Persons VALUES (’Jimmy’, ‘Jackson’)
    2. INSERT (’Jimmy’, ‘Jackson’) INTO Persons
    3. INSERT VALUES (’Jimmy’, ‘Jackson’) INTO Persons
  17. With SQL, how can you insert “Olsen” as the “LastName” in the “Persons” table?
    1. INSERT INTO Persons (’Olsen’) INTO LastName
    2. INSERT INTO Persons (LastName) VALUES (’Olsen’)
    3. INSERT (’Olsen’) INTO Persons (LastName)
  18. How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
    1. MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
    2. UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
    3. UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
    4. MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
  19. With SQL, how can you delete the records where the “FirstName” is “Peter” in the Persons Table?
    1. DELETE FROM Persons WHERE FirstName = ‘Peter’
    2. DELETE FirstName=’Peter’ FROM Persons
    3. DELETE ROW FirstName=’Peter’ FROM Persons
  20. With SQL, how can you return the number of records in the “Persons” table?
    1. SELECT COLUMNS(*) FROM Persons
    2. SELECT COUNT(*) FROM Persons
    3. SELECT COUNT() FROM Person
    4. SELECT COLUMNS() FROM Persons


Firmansyah Wahyudiarto merupakan salah satu enthusiast di bidang teknologi informasi dan manajemen bisnis kontemporer. Saat ini bekerja di salah satu perusahaan swasta telekomunikasi Indonesia. Memiliki pengalaman dalam bidang pengembangan teknologi serta optimalisasi berbasis Internet diantaranya Search Engine Marketing, Web Development & Optimization, Geographic Information System, Computer Networking, serta pendalaman ilmu bisnis yaitu Strategic Management Business.

Leave a Comment