I would like to create a database with a couple tables in it. I am using SSMS and it is easy enough to accomplish said task by right-click creating, but I would like to use query/command line (not sure how to phrase that).
Create a database and table
CREATE DATABASE test_employees;
CREATE TABLE dbo.EmployeesBasicInfo
(
MyKeyField VarChar(8) PRIMARY KEY,
FirstName VarChar(30) NOT NULL,
LastName VarChar(50) NOT NULL,
DateStarted DateTime NOT NULL,
Age Int NOT NULL,
ModifiedDate DateTime NULL
);
But I have no idea where the table goes or how to move/link it to database test_employees.
Also, if you feel ambition in answering my question then the next step is to auto-generate data for all fields. Any links you could provide would be helpful. And, if anything I'm doing is not best-practice please let me know - I'm just getting into SQL.