Questions

1 Marks Each

🎯

Test yourself on this topic

43 questions · timed · auto-graded

Question 21 Mark
Choose the correct answer for the following questions on the basis of given table:

Table: Persons

FirstName LastName
Naveen Gupta
Ram Sharma
Mohan Kumar
Aayu Chugh

(a) With SQL, how do you select a column named "FirstName "from a table named "Persons "?

(b) With SQL, how do we select all the columns from a table named "Persons "?

(c) With SQL, how do we select all the records from a table named "Persons "where the value of the column "FirstName "is "Naveen "?

(d) With SQL, how do we select all the records from a table named "Persons "where the value of the column "FirstName "starts with an "a "?

(e) With SQL, how do we select all the records from a table named "Persons "where the "FirstName "is "Aayu "and the "LastName "is "Chugh "?

(f) With SQL, how do we select all the records from a table named "Persons "where the "LastName "is alphabetically between (and including) "Sharma "and "Chugh "?

(g) With SQL, how can we return all the records from a table named "Persons "sorted descending by "FirstName "?

(h) With SQL, how can we insert a new record into the "Persons "table?

(i) With SQL, how can we insert "Mehta "as the "LastName "in the "Persons "table?

(j) How can we change "Chugh "into "Bajaj "in the "LastName "column in the Persons table?

(k) With SQL, how can you delete the records where the "FirstName "is "Gupta "in the Persons Table?

(l) With SQL, how can you return the number of records in the "Persons "table?

View full question & answer
Question 31 Mark
Question write SQL statements for the following.

(i) To print the current date and time.

(ii) To print the today ’s date only.

(iii) To print the month name from the date "2019-10-10 ".

(iv) To the month from the date "2020-01-10 "

(v) To print the square of 5.

(vi) To round of the number 345.56 upto 1 decimal place.

(vii) To print the modulus of 4 to 5.

(viii) To round of the number 4567.10 multiple of 10.

Answer

(i)

(ii)

(iii)

(iv)

(v)

(vi)

(vii)

(viii)

View full question & answer
Question 41 Mark

Assuming the given text "Informatics Practices Class-XII ", write the SQL statements to do the following:

(i) To print the length of the above string.

(ii) To extract "mat "from the string.

(iii) To print extract "xii "and print it in upper case.

(iv) To print above complete string in upper case.

(v) To print "info "in lower case.

(vi) To check whether "ces "is available in the above string or not.

(vii) To remove the leading and trailing spaces.

Answer
(i)

(ii)

(iii)

(iv)

(v)

(vi)

(vii)

View full question & answer
1 Marks Each - Computer Science STD 12 Commerce Questions - Vidyadip