Database Management (DBMS)
Keys, relational algebra, normal forms, SQL commands and clauses, ACID transactions, E-R diagrams, views and indexes.
Learn: notes, formulas, solved examples and question book
ਨਮੂਨਾ ਪ੍ਰਸ਼ਨ ਅਤੇ ਹੱਲ
ਪ੍ਰਸ਼ਨ ਅਜੇ English ਅਤੇ हिन्दी ਵਿੱਚ ਹਨ। ਬਾਕੀ ਐਪ ਤੁਹਾਡੀ ਭਾਸ਼ਾ ਵਿੱਚ ਹੈ।
1. Which command removes all rows of a table but keeps its structure, and cannot use a WHERE clause?
- ALTER
- TRUNCATE
- DROP
- DELETE
ਉੱਤਰ: B. ਹੱਲ ਵੇਖੋ
Answer: TRUNCATE
DELETE removes chosen rows (WHERE allowed); TRUNCATE empties the table quickly; DROP removes the table itself.
Source: NIELIT O-Level syllabus (networks, C programming, DBMS) and standard computer science textbook - textbook fact
2. A foreign key is an attribute that:
- refers to the primary key of another (or the same) table
- cannot have repeated values
- is always unique
- encrypts data
ਉੱਤਰ: A. ਹੱਲ ਵੇਖੋ
Answer: refers to the primary key of another (or the same) table
Foreign keys keep referential integrity: a value must exist in the referenced key or be NULL.
Source: NIELIT O-Level syllabus (networks, C programming, DBMS) and standard computer science textbook - textbook fact
3. A relation has 7 attributes, and its only candidate keys are the single attributes A and B. How many super keys does it have?
- 96
- 128
- 7
- 63
ਉੱਤਰ: A. ਹੱਲ ਵੇਖੋ
- Sets with A: 2^6; sets with B: 2^6; with both: 2^5
- 64 + 64 − 32 = 96
Answer: 96
ਉੱਪਰ "ਸ਼ੁਰੂ ਕਰੋ" ਦਬਾਓ: ਹਰ ਵਾਰ ਨਵੇਂ ਪ੍ਰਸ਼ਨ, ਉੱਤਰ ਅਤੇ ਪੂਰੇ ਹੱਲ ਨਾਲ।