Question

Create a database and perform a query using SQLite. Include screen shots to show the database...

Create a database and perform a query using SQLite.

Include screen shots to show the database and at least one table you created.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
//Here is the database creation, using, table creation, insert values into table, and show the values of table and show databases​​​​​​​​​​​​​​​​ by using SQL commands. 

//I have attached screen shots which are included the data. 
​​​​​​​
mysql>create database company;
Query Ok,1 row affected (0.02 sec)
mysql> use company;
Database changed
mysql> create table emp(fname char(20),lname char(20),ssn int primary key,salary
 real,gender char(10));
Query OK, 0 rows affected (0.45 sec)

mysql> desc emp;
+--------+----------+------+-----+---------+-------+
| Field  | Type     | Null | Key | Default | Extra |
+--------+----------+------+-----+---------+-------+
| fname  | char(20) | YES  |     | NULL    |       |
| lname  | char(20) | YES  |     | NULL    |       |
| ssn    | int(11)  | NO   | PRI | NULL    |       |
| salary | double   | YES  |     | NULL    |       |
| gender | char(10) | YES  |     | NULL    |       |
+--------+----------+------+-----+---------+-------+
5 rows in set (0.13 sec)

mysql> insert into emp(fname,lname,ssn,salary,gender)values("Rama","Krishna",145
67,50000,"M"),("Rajesh","Kumar",15678,30000,"M"),("Jiya","Singh",15876,35000,"F"
),("Kalpana","Kumari",17894,45000,"F"),("John","Charles",18934,50000,"M");
Query OK, 5 rows affected (0.09 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> select *from emp;
+---------+---------+-------+--------+--------+
| fname   | lname   | ssn   | salary | gender |
+---------+---------+-------+--------+--------+
| Rama    | Krishna | 14567 |  50000 | M      |
| Rajesh  | Kumar   | 15678 |  30000 | M      |
| Jiya    | Singh   | 15876 |  35000 | F      |
| Kalpana | Kumari  | 17894 |  45000 | F      |
| John    | Charles | 18934 |  50000 | M      |
+---------+---------+-------+--------+--------+
5 rows in set (0.05 sec)

mysql> select fname,ssn,salary from emp where gender="M";
+--------+-------+--------+
| fname  | ssn   | salary |
+--------+-------+--------+
| Rama   | 14567 |  50000 |
| Rajesh | 15678 |  30000 |
| John   | 18934 |  50000 |
+--------+-------+--------+
3 rows in set (0.00 sec)

mysql> select fname,lname,salary from emp where ssn="14567";
+-------+---------+--------+
| fname | lname   | salary |
+-------+---------+--------+
| Rama  | Krishna |  50000 |
+-------+---------+--------+
1 row in set (0.06 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| books              |
| company            |
| krish              |
| mysql              |
| performance_schema |
| sakila             |
| test               |
| world              |
+--------------------+
9 rows in set (0.00 sec)

mysql>

Add a comment
Know the answer?
Add Answer to:
Create a database and perform a query using SQLite. Include screen shots to show the database...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • R Create a SQLite database in memory and populate it with a built-in dataset of your...

    R Create a SQLite database in memory and populate it with a built-in dataset of your choice. Then run some SQL queries on it to show that it works.

  • It is possible, using the Make Table query to create a table in another database. True...

    It is possible, using the Make Table query to create a table in another database. True False Depending on what an Update query is designed to do; it is often not a good idea to run the query again. True False As with other queries, action queries can be __?____ for use at a later time.

  • Provide Query to create Database In this database at least a table of customers, sales, employees,...

    Provide Query to create Database In this database at least a table of customers, sales, employees, suppliers, products, the detail of the sale, and the equipment (Laptop and Destop) which facilitates billing and inventory management by the database is needed. number of brands and units of computers sold at retail or wholesale. The company does not have a database and they use an old way of information that can also be easily lost. They need a database to have organized...

  • Using the MySQL Workbench create a new database using your design specifications Add at least 10...

    Using the MySQL Workbench create a new database using your design specifications Add at least 10 records to your tables. Note: Certain tables may not require 10 records and that is ok as long as your main tables have 10 or more Create MySQL statements that will retrieve all records or rows from the tables in your database Create 10 MySQL statements that will retrieve specified records or rows from one table in your database Create 10 MySQL statements that...

  • Please write SQL Query for following questions using Northwind Database: 1. Create a procedure to add...

    Please write SQL Query for following questions using Northwind Database: 1. Create a procedure to add a new record to Territories table. Call it NewTerr. Add the following records using the procedure. TerritoryID        TerritoryDescription     Region 88888 Brooklyn 1 99999 Waco 4 77777 Long Beach 2 2. Create an Update Procedure that will change the Region from 1 to 3 for record with TerritoryID 88888. Call it Update88. 3. Create a Delete Procedure that will delete the one record from...

  • Database For this lab you will be using SQL SELECT statements to query your database tables....

    Database For this lab you will be using SQL SELECT statements to query your database tables. You will be turning in the results of the following queries: 1. List all Patients and what Bed they are assigned to 2. List all patients who had Treatments and what Treatment they received 3. List all patients who had tests and what Test they had 4. List the employees (doctors, nurses, etc.) who assisted each patient. 5. List all patients in alphabetical order...

  • Using the Sakila database: Create a query that lists the following information for films: title, description,...

    Using the Sakila database: Create a query that lists the following information for films: title, description, rental_duration, rental_rate, length, category, number of copies of film in inventory.

  • Please access to TUN SQL/Assistant using the default database = db_pvfc12_std 1.- Run a query to...

    Please access to TUN SQL/Assistant using the default database = db_pvfc12_std 1.- Run a query to retrieve all the data field from db_pvfc12_std in table CUSTOMER_T 2.- Run a query to retrieve record --> CustomerID = 11, How many records did you get and why? 3.- Run a query to retrieve all the data field from table Order_T               Once retrieved:                              3.1.- Please name the fields showing: Primary Key, Foreign Key and other fields                              3.2.- What type of...

  • Using python and SQLite, connect to the database called "world.db". a. Input the data into table...

    Using python and SQLite, connect to the database called "world.db". a. Input the data into table 'city' and print b. Using python, print out the country Name, Continent, Region and the country's Population of all the countries, whose country population is larger than 1,000,000,000. Print out all the fields for the cities in the U.S. whose city population is larger than 1,000,000.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT