Your friend Daenerys Targaryen wants to help the flood affected people. So she wants to store some data into a database to ease her works. But currently she doesn't have any DBMS installed. Besides she's scared to access internet because she thinks her PC can be hacked (just like HBO's).
So she asked for your help. You cannot use anything except an editor and compiler of your choice (Of course for security reasons).
Design a simple DBMS with basic functionalities of MySQL.
You have data of first_name, last_name, location, age and family_members of each flood victim. There are N flood victims.
Database name : People
Table name : people
Queries are:
For simplicity, no field will be longer than 18 characters.
Reserve 20 characters for each field, no matter what the size of field (or string whatever).
Place the names of the columns, values in the left.
Before any query, database should be selected first and then table too.
If not, print I can't write queries. So Shakib is a bad boy.
See sample input-output for clarification.
The first line of the input is N (1 <= N <= 1000). Then N lines follow.
Each line contains data of one flood victim. Then receive and process queries until Lol:Exit is the query.
Show the table according to the query. If query is wrong or not necessary print I can't write queries. So Shakib is a bad boy.
Input | Output |
---|---|
5 Humaun kabir Rajshahi 24 50 Didarul Islam Tangail 24 52 Sakibul Rumi Vulegesi 65 120 Shakir Romeo Jessore 65 350 Soummyo Avik Chittagong 120 350 mysql -u root -p People use people order by first_name asc select * from people use people Lol:Exit | +--------------------+--------------------+--------------------+--------------------+--------------------+ | first_name | last_name | location | age | family_members | +--------------------+--------------------+--------------------+--------------------+--------------------+ | Didarul | Islam | Tangail | 24 | 52 | | Humaun | kabir | Rajshahi | 24 | 50 | | Sakibul | Rumi | Vulegesi | 65 | 120 | | Shakir | Romeo | Jessore | 65 | 350 | | Soummyo | Avik | Chittagong | 120 | 350 | +--------------------+--------------------+--------------------+--------------------+--------------------+ I can't write queries. So Shakib is a bad boy. |
If any part (column) is told to sort, we need to care about only that part. Any other column should remain unchanged. Do compare only the part which is in the queries.