Govt. Exams
Entrance Exams
UNIQUE constraint prevents duplicate values. PRIMARY KEY is unique + NOT NULL. NOT NULL only prevents nulls. FOREIGN KEY maintains referential integrity.
ALTER TABLE ... ADD COLUMN syntax is correct for adding columns. Other options are invalid SQL syntax.
COUNT(column_name), SUM(), AVG(), MAX(), and MIN() all ignore NULL values. COUNT(*) counts all rows including NULLs.
ORDER BY sorts in ascending order by default. Use DESC keyword for descending order.
INNER JOIN returns only matching records from both tables, perfect for finding students with matching course enrollments.
TRUNCATE removes all rows but keeps the table structure. DELETE removes rows one by one and can be rolled back. DROP removes the entire table.
CASE statement evaluates conditions sequentially and returns value for first TRUE condition. 1=1 is TRUE, so 'A' is returned.
The modulus operator (%) returns remainder after division. 10 divided by 3 gives remainder 1.
INNER JOIN returns only rows where join condition is satisfied in both tables. Other JOINs include non-matching rows.
DISTINCT eliminates duplicate rows from query results, ensuring each unique combination appears only once.