For people working with database tables:
Most will want to check out the columns in the table and do a quick scan to get 10 rows to sample data in the table.
Here’s the SQL syntax for doing that with some of the biggest relational database vendors.
The first query gets 10 rows from a table called ‘Students’.
The second query shows all the columns in this table.
The third query is an alternative style (if exists).
MySql Syntax
SELECT * FROM Students LIMIT 10;
# Two ways to do in mysql
DESCRIBE Students;
SELECT * FROM information_schema.columns WHERE table_name = 'Students';
Postgres syntax
SELECT * FROM Students LIMIT 10;
# this one below only works in console
d+ Students
# or
SELECT column_name, data_type
FROM INFORMATION_SCHEMA.COLUMNS where table_name = 'Students';
MicroSoft Sql Server T-Sql syntax
SELECT TOP 10 * FROM Students
GO
SELECT *
FROM information_schema.columns
WHERE table_name = 'Students'
ORDER BY ordinal_position
GO
Oracle PL/Sql syntax
SELECT * FROM Students WHERE ROWNUM <=10;
DESCRIBE Students;