SQL Queries Using SQLite

Verified

Added on  2020/05/16

|7
|395
|245
AI Summary
This assignment focuses on performing various SQL queries using the SQLite database. It consists of eight query problems in Part A, covering topics such as retrieving specific data, using aggregate functions (MAX), joining tables, and filtering results. Part B includes five DML (Data Manipulation Language) statements involving INSERT, ALTER, UPDATE, DELETE operations to modify the customer table. The assignment also provides a bibliography listing relevant resources.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: SQL QUERY USING SQLITE
SQL Query Using SQLite
Name of the Student
Student ID
Subject Code

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1SQL QUERY USING SQLITE
Part A:
Query 1:
select * from vendor where v_state = '';
Query 2:
select * from customer where CUS_BALANCE>300 AND CUS_BALANCE<400;
Query 3:
Select DISTINCT CUS_LNAME from customer inner join invoice on
customer.CUS_CODE = invoice.CUS_CODE;
Document Page
2SQL QUERY USING SQLITE
Query 4:
select max (CUS_BALANCE) from customer;
Query 5:
Select distinct CUS_CODE from customer where NOT EXISTS (select * from invoice
where customer.CUS_CODE = invoice.CUS_CODE);
Query 6:
Select distinct (CUS_FNAME || ' ' || CUS_LNAME) As 'Customer Name' from customer
where NOT EXISTS (select * from invoice where customer.CUS_CODE =
invoice.CUS_CODE);
Document Page
3SQL QUERY USING SQLITE
Query 7:
select c.CUS_CODE, count(l.INV_NUMBER) as 'Invoices_generated' from Customer c
inner join invoice i on c.CUS_CODE = i.CUS_CODE inner join line l ON
i.INV_NUMBER=l.INV_NUMBER Group BY c.CUS_CODE;
Query 8:
select c.CUS_CODE, (CUS_FNAME || ' ' || CUS_LNAME) As 'Customer Name',
count(l.INV_NUMBER) as 'Invoices_generated' from Customer c inner join invoice i on
c.CUS_CODE = i.CUS_CODE inner join line l ON i.INV_NUMBER=l.INV_NUMBER Group
BY c.CUS_CODE;
Part B:
Query 1:
INSERT INTO CUSTOMER VALUES(' 11537446 ',' VAISHNAV','
VIPULKUMAR','A','615','844-2573','0');

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4SQL QUERY USING SQLITE
Query 2:
alter table customer add credit_history VARCHAR(6);
Query 3:
update customer set credit_history = 'BAD' where CUS_CODE = 10011;
Query 4:
delete from EMP where EMP_LNAME = 'Genkazi' AND EMP_FNAME = 'Leighla';
Document Page
5SQL QUERY USING SQLITE
Query 5:
Alter table emp add email_address VARCHAR(20);
Document Page
6SQL QUERY USING SQLITE
Bibliography:
Kumar, R., Gupta, N., Charu, S., Jain, K., & Jangir, S. K. (2014). Open source solution for cloud
computing platform using OpenStack. International Journal of Computer Science and
Mobile Computing, 3(5), 89-98.
Ripley, B., Lapsley, M., & Ripley, M. B. (2017). Package ‘RODBC’.
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]