[Show all top banners]

newbie69

More by newbie69
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 FOR SQL GURUS
[VIEWED 2943 TIMES]
SAVE! for ease of future access.
Posted on 06-21-17 6:49 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Really need help with SQL
Does the code look right based on the questions?

1. Populate each table with 10 entries. (Check that the data is realistic)
/* Query populates 10 entries from each table */
SELECT * FROM CUSTOMER_t, VEHICLE_t, PARTS_t, SERVICE_TICKET_t, TECHNICIAN_t, INVOICE_t limit 10

SELECT * FROM CUSTOMER_t limit 10
SELECT * FROM VEHICLE_t limit 10
SELECT * FROM PARTS_t limit 10
SELECT * FROM SERVICE_TICKET_t limit 10
SELECT * FROM TECHNICIAN_t limit 10
SELECT * FROM INVOICE_t limit 10

2. Write a query that selects several entries in a table based on a particular attribute or set of attributes.
/* Query based on particular attribute */
SELECT First_Name FROM CUSTOMER_t WHERE CUSTOMER_t.Insurance_Company in (‘All State’)
GROUP BY First_Name

3. Write a query that joins data from two or more tables and outputs that data
/* Query that joins data from two tables */
SELECT SERVICE_TICKET_t.Ticket_ID, CUSTOMER_t.First_Name, SERVICE_Ticket_t.DATE_RECEIVED
FROM SERVICE_TICKET_t
INNER JOIN CUSTOMER_t ON SERVICE_TICKET_t.Customer_ID=CUSTOMER_t.Customer_ID;

4. Delete or change an entry from a table based on a particular attribute or set of attributes. (Comment this code carefully)
/* Deleting entry from table on given attribute */
DELETE FROM CUSTOMER_t
WHERE First_Name=‘Tony Mao’;

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
शीर्षक जे पनि हुन सक्छ।
What are your first memories of when Nepal Television Began?
Sajha Poll: नेपालका सबैभन्दा आकर्षक महिला को हुन्?
NRN card pros and cons?
Basnet or Basnyat ??
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
अमेरिकामा छोरा हराएको सूचना
TPS Re-registration case still pending ..
Breathe in. Breathe out.
nrn citizenship
ढ्याउ गर्दा दसैँको खसी गनाउच
Top 10 Anti-vaxxers Who Got Owned by COVID
Sajha has turned into MAGATs nest
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
Doctors dying suddenly or unexpectedly since the rollout of COVID-19 vaccines
Send Parcels from USA to Nepal & Worldwide.
Why is every youths leaving Nepal? Why are not youths entering politics and serving the country, starting business etc?
TPS Work Permit/How long your took?
Nas and The Bokas: Coming to a Night Club near you
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters