0% found this document useful (0 votes)
3 views1 page

BT 1

The document defines a SQL table named 'Customers' with various fields for customer information. It includes sample data for five customers from different countries. Additionally, there is a query to filter and retrieve all customers from the UK.

Uploaded by

lamha3375
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

BT 1

The document defines a SQL table named 'Customers' with various fields for customer information. It includes sample data for five customers from different countries. Additionally, there is a query to filter and retrieve all customers from the UK.

Uploaded by

lamha3375
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CREATE TABLE Customers (

CustomerID INT PRIMARY KEY,


CustomerName VARCHAR(100),
ContactName VARCHAR(100),
Address VARCHAR(200),
City VARCHAR(50),
PostalCode VARCHAR(20),
Country VARCHAR(50)
);

INSERT INTO Customers (CustomerID, CustomerName, ContactName, Address, City,


PostalCode, Country) VALUES
(1, 'Alfreds Futterkiste', 'Maria Anders', 'Obere Str. 57', 'Berlin', '12209', 'Germany'),
(2, 'Ana Trujillo Emparedados y helados', 'Ana Trujillo', 'Avda. de la Constitución 2222',
'Mexico D.F.', '05021', 'Mexico'),
(3, 'Antonio Moreno Taqueria', 'Antonio Moreno', 'Mataderos 2312', 'México D.F.',
'05023', 'Mexico'),
(4, 'Around the Horn', 'Thomas Hardy', '120 Hanover Sq.', 'London', 'WA1 1DP', 'UK'),
(5, 'Berglunds snabbkop', 'Christina Berglund', 'Berguvsvagen 8', 'Lulea', 'S-958 22',
'Sweden');

--Truy vấn lọc ra tất cả khách hàng đến từ UK


SELECT * FROM Customers WHERE Country LIKE '%UK%';

You might also like