Skip to content

Commit 3cfbb53

Browse files
authored
SQL_command___Our_First_Database
1 parent 1504b8f commit 3cfbb53

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Instructions
2+
If you don't already have it, install the SQLite Browser from http://sqlitebrowser.org/.
3+
4+
Then, create a SQLITE database or use an existing database and create a table in the database called "Ages":
5+
6+
7+
CREATE TABLE Ages (
8+
name VARCHAR(128),
9+
age INTEGER
10+
)
11+
12+
13+
Then make sure the table is empty by deleting any rows that you previously inserted, and insert these rows and only these rows with the following commands:
14+
15+
DELETE FROM Ages;
16+
INSERT INTO Ages (name, age) VALUES ('Millar', 38);
17+
INSERT INTO Ages (name, age) VALUES ('Lucyanne', 36);
18+
INSERT INTO Ages (name, age) VALUES ('Honey', 19);
19+
INSERT INTO Ages (name, age) VALUES ('Brenna', 19);
20+
INSERT INTO Ages (name, age) VALUES ('Mitch', 38);
21+
22+
23+
Once the inserts are done, run the following SQL command:
24+
25+
SELECT hex(name || age) AS X FROM Ages ORDER BY X
26+
27+
28+
Find the first row in the resulting record set and enter the long string that looks like 53656C696E613333.
29+
30+
Note: This assignment must be done using SQLite - in particular, the SELECT query above will not work in any other database. So you cannot use MySQL or Oracle for this assignment.

0 commit comments

Comments
 (0)