What do column flags mean in MySQL Workbench?
PK - Primary Key
NN - Not Null
BIN - Binary (stores data as binary strings. There is no character set so sorting and comparison is based on the numeric values of the bytes in the values.)
UN - Unsigned (non-negative numbers only. so if the range is -500 to 500, instead its 0 - 1000, the range is the same but it starts at 0)
UQ - Create/remove Unique Key
ZF - Zero-Filled (if the length is 5 like INT(5) then every field is filled with 0’s to the 5th digit. 12 = 00012, 400 = 00400, etc. )
AI - Auto Increment
G - Generated column. i.e. value generated by a formula based on the other columns
What does the column flag G in MySQL Workbench mean
Having looked through some of the Workbench code and the MySQL documentation, it looks like the G column is for Generated Columns.
In the source code, there's the following within the mysql_table_editor_column_page file (line 132 at the time of writing):
model->model().append_check_column(MySQLTableColumnsListBE::IsGenerated, "G", EDITABLE);
Other code in the same area gives the layout consistent with what you're seeing in the visual for PK, NN etc., which is viewable in the source.
What do the mysql workbench column icons mean
Key: (Part of) Primary Key
Filled Diamond: NOT NULL
Not filled Diamond: NULL
Red colored: (Part of) Foreign key
Blue lined Diamond: Simple attribute (no key)
Can be combined for example:
is a Red colored Key so it's a Primary Key which is also a Foreign Key
is a Yellow (non Red) Key so it's only a Primary Key
is a blue lined filled diamond so it's a NOT NULL simple attribute
is a red colored filled diamond so it's a NOT NULL Foreign Key
is a blue lined not filled diamond so it's a simple attribute which can be NULL
is a red colored not filled diamond so it's a Foreign Key which can be NULL
On a sidenote:
Mind you that MySQL Workbench has a buggy Database > Reverse Engineer (Ctrl-R) option with which you can generate a ERD diagram and that uses these icons. In my experience the v6.x is better than v8.x but both have their quirks/bugs.
Change column flags in MySQL Workbench scripting shell
You need to use grt.root.wb.doc.physicalModels[0].catalog.schemata[0].tables[1].columns[7].flags.append('UNSIGNED')
Change type / len of a user defined column in My SQL Workbench
SET group_concat_max_len = 10000;
What is the meaning of the blue line and the green line in MySQL workbench?
The connections show relationships (foreign keys). That should be clear.
When you hover with the mouse over a table figure, all connections are highlighted which either go out from or come in to that table.
Outgoing connections, that is, foreign keys defined on that table, which reference a different table are shown in green.
Incoming connections, that is, foreign keys defined in another table, which end on the current table are colored blue.
The referenced fields are colored the same way as their associated relationship.
Currently table city
is active, so the foreign key from city.country_id
to country.country_id
is colored green (it's an outgoing connection). Table address
has defined a foreign key to city, which is shown in blue. Now hover address
and you will see that the connection color to city
switches from blue to green.
how to hide other column
You have to add hidden column into the select query to retreive the data.
Hide the column from the DataGridView instead.
try
MysqlConn.Open()
Dim Query As String
Query = "select ID,LastName,FirstName,MiddleName,Address from god.precord"
COMMAND = New MySqlCommand(Query, MysqlConn)
SDA.SelectCommand = COMMAND
SDA.Fill(dbDataSet)
bSource.DataSource = dbDataSet
DataGridView1.DataSource = bSource
SDA.Update(dbDataSet)
DataGridView1.Columns("Address").Visible = false
MysqlConn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
MysqlConn.Dispose()
End Try
Related Topics
How to Find the Last Modified Date, Modified User of an Stored Procedure in SQL Server 2008
Join Four Tables Involving Left Join Without Duplicates
Oledb Case When in Select Query
Add Missing Data from Previous Month or Year Cumulatively
SQL Queries on String Columns - Sorting According to Language
Remove Trailing Spaces and Update in Columns in SQL Server
How to Select Top X But Still Get a Count of the Whole Query
Informix SQL - List All Fields & Tables
Pivot a Table on a Value But Group the Data on One Line by Another
Database Design for 'Followers' and 'Followings'
Find N Nearest Neighbors for Given Point Using Postgis
When Is a Good Situation to Use a Full Outer Join
Delete Rows with Foreign Key in Postgresql
Select Count of Rows in Another Table in a Postgres Select Statement