How do you list all users
in this table
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| users | CREATE TABLE `users` (
`id` int(11) DEFAULT NULL,
`name` varchar(256) DEFAULT NULL,
`age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
- SELECT ALL users;
- DELETE * FROM users;
- SELECT * FROM users;
How do you change the name of users
with the record id = 89
to Holberton
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| users | CREATE TABLE `users` (
`id` int(11) DEFAULT NULL,
`name` varchar(256) DEFAULT NULL,
`age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
- UPDATE users SET name = “Holberton”;
- UPDATE users SET name = “Holberton” WHERE id = 89;
- CHANGE users SET name = “Holberton” WHERE id = 89;
How do you delete the users record with id = 89 in this table?
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| users | CREATE TABLE `users` (
`id` int(11) DEFAULT NULL,
`name` varchar(256) DEFAULT NULL,
`age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
- DELETE FROM users;
- DELETE users WHERE id = 89;
- DELETE FROM users WHERE id = 89;
- DELETE FROM users WHERE id IS EQUAL TO 89;
What is a relational database? (please select all correct answers)
- married databases
- a table containing only one object representation
- data are organized by tables and indexes
- a collection of data
- a database
- a table containing multiple object representation
- data are organized by tables, records and columns
What does DDL stand for?
- Data Document Language
- Data Definition Language
- Database Definition Language
- Document Data Language
What does SQL stand for?
- Solid Query Language
- Sequences of Query Logic
- Structured Query Language
- Structured Question Language
How do you add a new record into the table users
?
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| users | CREATE TABLE `users` (
`id` int(11) DEFAULT NULL,
`name` varchar(256) DEFAULT NULL,
`age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
- INSERT INTO users (id, name, age) VALUES (2, “Betty”, 30);
- INSERT users (id, name, age) VALUES (2, “Betty”, 30);
- INSERT INTO users (id, name) VALUES (2, “Betty”, 30);
- INSERT INTO users (id, name, age) VALUES (2, “Betty”);
How do you list all users
records with age > 21
in this table
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| users | CREATE TABLE `users` (
`id` int(11) DEFAULT NULL,
`name` varchar(256) DEFAULT NULL,
`age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
- SELECT * FROM users WHERE age > 21;
- SELECT * FROM users WHERE age < 21;
- SELECT * FROM users WHERE age IS UP TO 21;
- SELECT * FROM users WHERE age BETWEEN 21 AND 89;
What does DML stand for?
- Data Manipulation Language
- Database Manipulation Language
- Document Manipulation Language
- Document Model Language