What is the exact difference between SGMII and 1000Base-X?
To elaborate on @Majenko's answer, both SGMII and 1000Base-x are dual 1000Mbps SERDES pairs (one in each direction), at least until the 1000Base-X signals reach the optical transceiver. The main difference is in the auto-negotiation capabilities.
In 1000Base-X, auto-negotiation is limited to flow-control (and duplex, which is not really used since it's always full-duplex).
In SGMII, auto-negotiation also allows the PHY to indicate to the MAC the post-PHY link speed. Even though the MAC-to-PHY SGMII link is always 1000Mbps, it supports 10, 100 and 1000Mbps past the PHY and the MAC need to know this to space out the bits properly (e. g. if the external link is 100Mbps, each bit on the SGMII link is sent 10 times).
Most Ethernet systems are made up of a number of building blocks. The two most important are the Ethernet MAC Device (the device that actually makes and receives Ethernet frames), and the Ethernet PHY (PHYsical interface) device - the device that connects you to your wires, fibre, etc.
These two devices are connected using a Media Independent Interface (MII). In gigabit ethernet it's the SGMII - Serial Gigabit Media Independent Interface.
So your Ethernet chip would connect to a 1000Base-X PHY using SGMII. It could instead connect to a 1000Base-T PHY device using the same SGMII interface.
There are PHYs with RGMII, SGMII and MDI. In these case RGMII connect to MAC. SGMII connect to a media module, such as SFP module which can be fiber or copper. MDI as usual for Copper Transformer interface. In some PHY the link to MAC is over SGMII.