MySQL Database Management System

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What is the purpose of the UPDATE command in SQL?

  • To drop a table from the database
  • To create a new table in the database
  • To modify existing data in a table (correct)
  • To delete specific rows from a table

What is the syntax of the UPDATE command to change the salary of an employee to 55000 where the employee code is 1009?

  • UPDATE EMPLOYEE SET ECODE = 1009 WHERE GROSS = 55000;
  • UPDATE EMPLOYEE SET ECODE = 55000 WHERE GROSS = 1009;
  • UPDATE EMPLOYEE SET GROSS = 1009 WHERE ECODE = 55000;
  • UPDATE EMPLOYEE SET GROSS = 55000 WHERE ECODE = 1009; (correct)

What is the effect of the command UPDATE EMPLOYEE SET GROSS = GROSS + 1000;

  • Deletes the salary of each employee
  • Sets the salary of each employee to 1000
  • Decreases the salary of each employee by 1000
  • Increases the salary of each employee by 1000 (correct)

What is the purpose of the DELETE command in SQL?

<p>To delete specific rows from a table (C)</p> Signup and view all the answers

What is the effect of the command DELETE FROM EMPLOYEE WHERE GRADE = 'A1';

<p>Deletes only the rows where the grade is 'A1' from the EMPLOYEE table (A)</p> Signup and view all the answers

What is the effect of the command DELETE FROM EMPLOYEE;

<p>Deletes all rows from the EMPLOYEE table (C)</p> Signup and view all the answers

What is the purpose of the DROP TABLE command in SQL?

<p>To drop a table from the database (D)</p> Signup and view all the answers

What is the syntax of the DROP TABLE command to drop the EMPLOYEE table?

<p>DROP TABLE EMPLOYEE; (A)</p> Signup and view all the answers

What is the effect of the command UPDATE EMPLOYEE SET GROSS = 58000, GRADE='B2' WHERE ECODE = 1009;

<p>Updates the salary to 58000 and grade to 'B2' for the employee with code 1009 (B)</p> Signup and view all the answers

What is the effect of the command UPDATE EMPLOYEE SET GROSS = GROSS * 2 WHERE GRADE='A1' OR GRADE='A2';

<p>Doubles the salary of employees with grade 'A1' or 'A2' (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

MySQL và SQL
5 questions

MySQL và SQL

Bùi Khắc Điều avatar
Bùi Khắc Điều
SQL Basics in MySQL
13 questions

SQL Basics in MySQL

EffortlessDrama avatar
EffortlessDrama
MySQL Database Management
41 questions
Use Quizgecko on...
Browser
Browser