Hello everybody. Today we will directly start creating a table in the Customers database created yesterday. Open the SQL Server Management Studio and click on New Query (see Figure1 ). You can see a blank screen. This is the place where we write queries to communicate with the database. Figure1 : Click on New Query To insert a Customer record, we need a table made up of rows and columns to occupy the record. Let’s start creating a table by writing the following query in the editor (see Figure2 ), Figure2 : Creating a table CustomerDetails 1. use [Customers] 2. --Creating a table to store customer records 3. CREATE TABLE CustomerDetails 4. ( 5. Cid int , 6. Cname varchar ( 15 ), 7. Address varchar ( 50 ), 8. City varchar ( 15 ), 9. Country varchar ( 15 ) 10. ) We can run the query by highlighting the code and pressing the “Execute” or “F5” button. The code is numbered for a line by line explanation. 1. Mentioning the databas...
Hello everybody. Welcome to my blog. This is my very first post and thanks in advance for reading this. I will be writing a series of blogs on learning Microsoft SQL Server. My target though will be for students and beginners, but the long-term goal is to make every beginner an expert. Experienced professionals can also use this to revise the topics as everything is going to be in a short and crisp format. I am not going to concentrate too much about the theories, architectures and designs. My posts will be on to start coding in SQL. However, important theoretical concepts will be explained simultaneously along with the code. From writing a simple SQL query to creating complex Stored Procedures and functions, we will be crossing all nook and corner of this great stuff. Let’s dive into the tutorial. Getting started with SQL ...