About Sql Server

Following are some of the multiple choice questions on the Sql Server with answers that will help the students in developing their knowledge.

Sql Server MCQ

1. What is a field?

  • A collection of information
  • A single item of information
  • A list of information
  • A group of records

2. Which SQL function is used to count the number of rows in a SQL query?

  • COUNT()
  • NUMBER()
  • SUM()
  • COUNT(*)

3. What does the ALTER TABLE clause do?

  • The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
  • The SQL ALTER TABLE clause is used to insert data into database table
  • THE SQL ALTER TABLE deletes data from database table
  • The SQL ALTER TABLE clause is used to delete a database table

4. What do the letters in CRUD stand for?

  • Create Read Update Delete
  • Craft Run Upload Database
  • Create Run Unrun Data
  • Crunch Read Uptime Downtime

5. A UNION query is which of the following?

  • Combines the output from multiple queries and does not include the same number of columns.
  • Combines the output from multiple queries and must include the same number of columns.
  • Combines the output from no more than two queries and does not include the same number of columns.
  • Combines the output from no more than two queries and must include the same number of columns.

6. SQL views can be used to hide?

  • Complicated SQL syntax
  • Rows
  • Columns
  • All of the above

7. The SQL SELECT statement is capable of

  • Projection
  • Selection
  • Protection & Security
  • Both A & B

8. Embedded SQL is which of the following?

  • The process of making an application capable of generating specific SQL code on the fly.
  • Hard-coded SQL statements in a trigger.
  • Hard-coded SQL statements in a program language such as Java.
  • Hard-coded SQL statements in a procedure.

9. The arranging of data in a logical sequence is called

  • Summarizing
  • Classifying
  • Sorting
  • Rearranging

10. Which SQL statement is used to insert new data in a database?

  • Insert Into
  • Add New
  • Insert Record
  • Add Record

11. A database is used to

  • store data
  • modify data
  • extract data
  • All of the above

12. Which of the following statements is true concerning subqueries?

  • Does not start with the word SELECT.
  • Involves the use of an inner and outer query.
  • Cannot return the same result as a query that is not a subquery.
  • All of the above

13. AND, OR and NOT are examples of

  • Clauses
  • Boolean operators
  • Conjuctive operators
  • Exclusive operators

14. SQL query to find the temperature in increasing order of all cities.

  • SELECT city FROM weather ORDER BY temperature
  • SELECT city, temperature FROM weather
  • SELECT city, temperature FROM weather ORDER BY temperature
  • SELECT city, temperature FROM weather ORDER BY city

15. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

  • SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
  • SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
  • SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
  • SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70

16. In sql the spaces at the end of the string are removed by

  • LTrim
  • Upper
  • Trim
  • Lower

17. Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.

  • SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
  • SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
  • SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
  • SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);

18. What is the correct order of clauses in a SQL statement?

  • SELECT, FROM, ORDER BY, WHERE
  • SELECT, FROM, WHERE, ORDER BY
  • SELECT, WHERE, FROM, ORDER BY
  • WHERE, FROM, SELECT, ORDER BY

19. What is Insert command in SQL?

  • The INSERT INTO statement is used to insert new records in a table.
  • The INSERT INTO statement is used to insert new column in a table.

20. The UPDATE SQL clause can _____________

  • update only one row at a time
  • update more than one row at a time
  • delete more than one row at a time
  • delete only one row at a time

21. With SQL how can I return all items in the Item table sorted from the lowest priced to the highest priced?

  • SELECT * FROM Items ORDER BY Price ASCENDING
  • SELECT * FROM Items ORDER BY Price ASC
  • SELECT * FROM Items BY Price LOWEST TO HIGHEST
  • SELECT * FROM Items ORDER BY Price DESC

22. How would you display Chairs in the Items table that have a Price greater than £50.

  • SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50
  • SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100
  • SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50
  • SELECT * FROM Items WHERE Price > 50

23. INSERT INTO tblNhanVienVALUES(N'Lê Văn Tám','04/30/1975')N character is stands for?

  • A String
  • An unicode string (Vietnameses)
  • varchar string
  • nvarchar string

24. With database qlBanHang1. tblNhanVien(MaNV, HoTen, MaCV, MaPB)2. tblPhongBan(MaPB, TenPB)3. tblChucVu(MaCV, TenCV)Which table do we insert data into first?

  • 1, 2, 3
  • 2, 3, 1
  • 3, 1, 2
  • 2, 1, 3

25. I want to create a table in my table named "actors" with two columns: "name" and "age." What statement will do this?

  • CREATE TABLE actors (name TEXT, age INTEGER);
  • CREATE actors WITH COLUMNS (name, age);
  • CREATE DATABASE actors WITH COLUMNS (name TEXT, age INTEGER);
  • CREATE actors (name, age): TABLE, TEXT, INTEGER;

26. I want to add the actor "Brad Pitt" (aged 56) to my table "actors." Which statement will do this?

  • CREATE ENTRY ("Brad Pitt", 56) IN TABLE actors;
  • INSERT "Brad Pitt" AND 56 INTO actors;
  • UPDATE age = 56 WHERE name = "Brad Pitt";
  • INSERT INTO actors VALUES ("Brad Pitt", 56);

27. I want to select EVERY column and entry in my "actors" table. How can I do that?

  • SELECT * FROM actors;
  • SELECT age FROM actors;
  • SELECT * FROM actors WHERE age > 30;
  • SELECT name, age FROM actors WHERE age < 30;

28. I want to select all columns in my "actors" table for all actors older than 30. How can I do that?

  • SELECT * FROM actors;
  • SELECT age FROM actors;
  • SELECT * FROM actors WHERE age > 30;
  • SELECT name, age FROM actors WHERE age < 30;

29. Reason for Mirroring Databse

  • Back up of the DB
  • Running the Copy of the DB simultaniously
  • To avoid slowness
  • Provide ExraSecurity

30. Advantages of Mirroring DB

  • Quick access of the DB
  • Less DownTime
  • Automatic Failover
  • All of the Above

31. There are 3 Transaction Log Backup files take on10th Sept, 14th Sept and 16th Sept. Which Backup files will be taken into account for Restoration

  • 16th Sept
  • 10th Sept
  • 14th Sept
  • All of the Above

32. If there are 2 Differential backup, a) taken on 4th Sept and b) bckup taken on 8th Sept. Which bckup file will be considered for "Restore"

  • 4th Sept
  • 8th Sept
  • Both Backup
  • None

33. Which of the Codd rule is associated with thestatement that changes in the data storage should not affect programs that access the data?

  • Information Rule
  • Comprehensive Sub Language
  • Physical Data Independence Rule
  • Distribution Rule

34. The table emp has 56 records. This value corresponds to which of the following term?

  • Relation
  • Degree
  • Cardinality
  • Domain

35. Main editions of SQL server

  • Entp Edition
  • Standard Edition
  • Business Intelligence Edition
  • All of the above

36. You are required to update the phone number for only the DesignerID "SMI01" in the "Designer" table. Which of these would successfully do that?

  • UPDATE Designer SET PhoneNo = '01224123456'
  • UPDATE Designer (PhoneNo) VALUES ('01224123456')
  • UPDATE Designer SET PhoneNo = '01224123456' WHERE DesignerID = 'SMI01'
  • UPDATE PhoneNo = '01224123456' FROM Designer WHERE DesignerID = 'SMI01'

37. You are required to update the Price = 10 for the ProductID include 1, 2, 5 in the "Product" table. Which of these would successfully do that?

  • UPDATE Product SET Price = 10 WHERE ProductID = (1 and 5 and 10)
  • UPDATE Product SET Price = 10 WHERE ProductID = (1 or 5 or 10)
  • UPDATE Product SET Price = 10 WHERE ProductID all (1, 5, 10)
  • UPDATE Product SET Price = 10 WHERE ProductID in (1, 5, 10)

38. In what order does SQL process the instructions?

  • FROM - SELECT - WHERE - ORDER BY
  • WHERE - FROM - SELECT - ORDER BY
  • SELECT - FROM - WHERE - ORDER BY
  • SELECT - FROM - ORDER By - WHERE

39. Which of the following is not a database data type?

  • text
  • array
  • array
  • date

40. Which example of the field name below is in camel case?

  • First Name
  • firstName
  • FIRSTNAME
  • firstname

41. Which symbol would you use to represent more than 50

  • = 50
  • < 50
  • > 50
  • # 50

42. The way to write the INSERT INTO statement

  • INSERT INTO table_name (column1, column2, column3, ...)VALUES (value1, value2, value3, ...);
  • INSERT INTO table_nameVALUES (value1, value2, value3, ...);
  • Both ways are true
  • Both ways are false

43. What's one solid reason for us to use databases instead of just storing stuff in a variable on the server?

  • If the server goes down, we won't lose all our data--our data will persist between sessions
  • A database is a more compact way of storing the information
  • Accessing information from a database is faster than accessing information from a variable
  • It's a toss-up, really--they're both good ways of storing information

44. Which aggregate function would I want to use to see which actor in my table is the oldest?

  • SUM
  • MAX
  • GROUP BY
  • WHERE

45. How many kinds of RAID are there

  • 4
  • 5
  • 6
  • 7

46. Mirroring is which kind of RAID

  • RAID 0
  • RAID 1
  • RAID 2
  • RAID 3

47. The back up that we take before Mirroring

  • Full Backup
  • Transactional Log Backup
  • Differential Backup
  • Both A & B

48. How many parts in a SQL UPDATE statement?

  • 2
  • 3
  • 4
  • 6

49. The correct order of keywords in an UPDATE SQL statement is?

  • UPDATE, SET, WHERE
  • UPDATE, WHERE, SET
  • SET, WHERE, UPDATE
  • WHERE, UPDATE, SET

50. How many columns can you set to update data in a SQL update statement?

  • only 1
  • unlimited
  • equal to the number of columns in the table
  • At least 1 column and maximum is equal to the number of columns in the table

Enjoyed the Quiz. Share this with friends

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.