Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which of the following information does an SQL DDL not specify?
a) The schema for each relation
b) The integrity constraints
c) The operations on the tuples
d) The security and authorization information for each relation

Answer: c [Reason:] The SQL DDL does not specify the operations that are supposed to be made on the tuples. DDL means Data definition language, hence it does not include the operations made.

2. Which of the following data types does the SQL standard not support?
a) char(n)
b) String(n)
c) varchar(n)
d) float(n)

Answer: b [Reason:] The SQL standard does not support String(n) but it supports char, varchar and float.

3. Which command is used to create a new relation in SQL
a) create table( , …)
b) create relation( , …)
c) new table( , …)
d) new relation( , …)

Answer: a [Reason:] We use the create table command to create a new relation in the database. The syntax is create table( , …);

4. If a1, a2, a3 are attributes in a relation and S is another relation, which of the following is an incorrect specification of an integrity constraint?
a) primary key(a1, a2, a3)
b) primary key(a1)
c) foreign key(a1, a2) references S
d) foreign key(a1, a2)

Answer: d [Reason:] Whenever the integrity constraint foreign key is mentioned, the attributes that are the foreign keys should always be referenced from the relation in which they are primary keys.

5. What is the syntax to load data into the database? (Consider D as the database and a, b, c as data)
a) enter into D (a, b, c);
b) insert into D values (a, b, c);
c) insert into D (a, b, c);
d) insert (a, b, c) values into D;

Answer: b [Reason:] To load data into a database we use the insert into command. The syntax is insert into D values (a, b, c) where a, b, c are the appropriate values

6. Which of the following commands do we use to delete a relation (R) from a database?
a) drop table R
b) drop relation R
c) delete table R
d) delete from R

Answer: a [Reason:] The drop table command is used to delete a relation from a database whereas the delete table removes all the tuples from a relation

7. Which of the following commands do we use to delete all the tuples from a relation (R)?
a) delete table R
b) drop table R
c) delete from R
d) drop from R

Answer: c [Reason:] The delete from command is used to delete all the tuples in a relation. The drop table totally deletes a relation.

8. Choose the correct command to delete an attribute A from a relation R
a) alter table R delete A
b) alter table R drop A
c) alter table drop A from R
d) delete A from R

Answer: b [Reason:] We can delete an attribute from a relation using the alter table command with the following syntax alter table drop

9. create table apartment(ownerID varchar (5), ownername varchar(25), floor numeric(4,0), primary key (ownerID));
Choose the correct option regarding the above statement
a) The statement is syntactically wrong
b) It creates a relation with three attributes ownerID, ownername, floor in which floor cannot be null.
c) It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null.
d) It creates a relation with three attributes ownerID, ownername, floor in which ownername must consist of at least 25 characters.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8229795,"math_prob":0.8700688,"size":2437,"snap":"2019-13-2019-22","text_gpt3_token_len":635,"char_repetition_ratio":0.14796548,"word_repetition_ratio":0.108843535,"special_character_ratio":0.24989742,"punctuation_ratio":0.101960786,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96727973,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-24T01:09:43Z\",\"WARC-Record-ID\":\"<urn:uuid:68cafc50-5e7e-4224-81cb-f5a0bae1d891>\",\"Content-Length\":\"49811\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6d9fa7a8-d80f-4d7e-8450-6f15b8756772>\",\"WARC-Concurrent-To\":\"<urn:uuid:f5731d46-9a48-4030-81d8-d2ce94de32c4>\",\"WARC-IP-Address\":\"104.18.55.73\",\"WARC-Target-URI\":\"https://distpub.com/rdbms-mcq-set-number-00629/\",\"WARC-Payload-Digest\":\"sha1:GTFPA4YXT6EKDS4XLAKUYSRUQGUEJC3M\",\"WARC-Block-Digest\":\"sha1:PGRMPBWLCRGZWNIPUMAL36KRAAG5VDJZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912203123.91_warc_CC-MAIN-20190324002035-20190324024035-00141.warc.gz\"}"}