Get Started - MSSQL setup and Beaver
Course Details
Contents
Access
Plan
Instructor
Karem Burgos Daluyen
About this Course
Getting Started
To start your first project on using MSSQL, I would suggest to use Docker for faster implementation.
Here are the Steps to installation --->
# Syllabus
2 itemsDocker, MSSQL setup, DBeaver Installation
TextDocker Installation
- Visit this official docker page and install the app base to your on your OS Docker Official.
- Create a file directory to your computer and create docker-compose.yaml and copy paste this line.
version: '3.8' services: sqlserver: image: mcr.microsoft.com/mssql/server:2022-latest container_name: sqlserver environment: ACCEPT_EULA: "Y" MSSQL_SA_PASSWORD: "--yourLongPassword--" ports: - "1433:1433" volumes: - sqlserverdata:/var/opt/mssql volumes: sqlserverdata: - Once you created the yaml file, open the file directory via powershell or command prompt, NOTE: allow docker name in your environment. Once it open please run this like
docker compose up - This will serve and execute the yaml to build and download the necessary file for your new mssql
- Once it completed, try openning the docker app and run the 'mssql' container
Please remember the port: 1433 as where your mssql running, use localhost as IP, and your password you setup to connect to the sql server is
--yourLongPassword--
DBeaver Installation
This app serves as you sql manager, it can connect to any sql server like MySQL, PostgreSQL, and many more
- Visit DBeaver Offcial site DBeaver Official.
- Select Windows/Linux/Mac depending to your OS.
- One the DBeaver install just follow the installation steps and apply defaults.
- Once installed, open the app and look for Connection Icon Upper left of your view screen.
- Select Microsoft SQL server
- Click Next and enter this credentials.
host: localhost port: 1433 username: sa >----//This is default password: --yourLongPassword--- Click Test Connection.
- Once the result is 'Connected' it means its ready to proceed. If the connection fails; Please check if 1433 is active or being used by other application, view mssql docker container if is still up running and veiw logs of the container if there is error occuring.
And thats it, you are ready for next course for new Lesson of basic and advance SQL queries
Possible Scopes of the Lesson
1. SELECT
* CTE, JOINS, ORDER BY, GROUP BY, COALESCE, AS, FOR JSON PATH, CASE/THEN/END, BEGIN, END
2. INSERT, UPDATE, DELETE
* MERGE, READONLY (Data Type) for TVP usage, DECLARE, temporary table
3. Data Type and length
4. 1st FORM Data Table
5. WHERE CLAUSE
6. Stored Procedure
Using DBeaver
TextGuidelines how to use DBeaver
To use the DBevear, much better how to use the left side ribbon because this is the side where evry operation of the data is implemented
This is the structure
master localhost:1433
Schemas
dbo
...
Table
Procedure
Views
Triggers
Data Types
For this discussion, master is the name of your default created database, this consist of Schema folder where this is where you create list of schema for purpose of isolation and arranging if operation on sql server is getting more complex and heavy.
- dbo is first default schema. This schema consist the following shown above.
- Table - is where you create your datatables
- Procedure - this is also called the function.
- Views - this is where you create pre-created SELECT query for ready to use accross the schema.
- Triggers - sometimes use in pre and post execution once the INSERT, UPDATE, DELETE was success queried and trigger will be used as fallback effect it could be either INSERT, UPDATE or DELETE process.
- Data Types - this is where you create table with certain data type, it could be used to store temporay files.
TO SIMPLY USE THE SQL MANAGER.
You can right click the dbo schema the click SQL editor to create for scripting. This way, it will pinpoint of what database schema does the query action can be executed without affecting the other schema.
Try also right clicking the Table, Procedure, etc to create new table or scripts without using CREATE scripts.
See below the screen and find Refreash, Save, Cancel, along with icon create new row, delete, edit, duplicate.
This are supporting feature to do changes to your database, at least it complete more thing efficiently.
See above the table you se to your screen and find the properties, data, diagram. This features show the propert of the tables from column name, data type, length, description, default, etc.
Data - this shows the Table and set of rows, and lastly the Diagram - this shows the relation visual aide of the interation between table to table.
Brought to you by